package blt.app_core.api.other;

import android.net.Uri;

import blt.app_core.api.base.bean.OAuth;
import blt.app_core.api.base.bean.State;
import blt.app_core.api.login.bean.User;
import blt.app_core.api.message.bean.BannerInfo;
import blt.app_core.api.other.bean.FeedBackVo;
import blt.app_core.utils.UriProdiver;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * Created by xgp on 2017/6/20.
 */

public interface OutService {
    @POST(UriProdiver.BANNER)
    Call<OAuth<BannerInfo>> getBanner();


    @Multipart
    @POST(UriProdiver.UPLOAD_IMG)
    Call<State<String>> upload(@Part("description") RequestBody description,
                               @Part MultipartBody.Part file);


    /**
     * 上传头像
     *
     * @param file
     * @return
     */
    @Multipart
    @POST(UriProdiver.UPlOAD_ICON)
    Call<State<User>> uploadIcon(
            @Part MultipartBody.Part file);


    @POST(UriProdiver.REGIST_PUSH)
    @FormUrlEncoded
    Call<State> registPush(@Field("deviceToken") String deviceToken);


    @POST(UriProdiver.GET_FEEDBACK_TYPE)
    @FormUrlEncoded
    Call<OAuth<FeedBackVo>> getType(@Field("group") String group);

    @POST(UriProdiver.SUBMIT_OPOION)
    @FormUrlEncoded
    Call<State> submitOpinion(@Field("feedbackType") String feedbackType, @Field("issue") String issue);

    @POST(UriProdiver.GET_FEEDBACK_LIST)
    @FormUrlEncoded
    Call<OAuth<FeedBackVo>> getFeedbackList(@Field("pageNum") int page, @Field("pageSize") int pageSize);

    @POST(UriProdiver.GET_FEEDBACK_DETAIL)
    @FormUrlEncoded
    Call<State> getFeedbackDetail(@Field("id") int id);
}
